//
//  DownloadRequest.h
//  yuimall_Iphone
//
//  Created by yuike6 yuike6 on 12-4-19.
//  Copyright (c) 2012年 yuike. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "header.h"
#import "YDownloadObjectModel.h"


@protocol YDownloadRequestDelegate;

@interface DownloadRequest : NSObject{
    
    NSString * name_;
    YDownloadObjectModel * downloadModel_;
    
    DownloadRecvData * recvData_;
    
    id<YDownloadRequestDelegate> delegate_;
    
    BOOL unNotifyAtFinish;
    PriorityLevel   level_;
}

@property (nonatomic, copy) NSString * name;
@property (nonatomic, retain) YDownloadObjectModel * downloadModel;

@property (nonatomic, retain)  DownloadRecvData * recvData;

@property (nonatomic, assign) id<YDownloadRequestDelegate> delegate;
@property (nonatomic, assign) BOOL unNotifyAtFinish;

@property (nonatomic, assign) PriorityLevel  level;


-(void) processOptionWithRequestFinish;

-(void) processOptionWithRequestFailed;

@end


@protocol YDownloadRequestDelegate <NSObject>
- (void) didTaskReceiveDataFinish   : (NSData *) theData    request:(DownloadRequest*) request;
- (void) didTaskReceiveFilename     : (NSString *) aName    request:(DownloadRequest*) request;
- (void) taskDataDownloadFailed     : (NSString *) reason   request:(DownloadRequest*) request;
- (void) taskDataDownloadAtPercent  : (NSNumber *) aPercent request:(DownloadRequest*) request;
@end